package com.ddyx.rest;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.service.CampaignInstanceService;
import com.ddyx.service.ICampaignTaskService;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;


/**
 * @ClassName: WxUserCampaignController.java
 * @Module: 微信用户拆红包活动请求控制器模块
 * @Description: 提供一起拆红包、拆一个新红包、查看好友手气功能
 */

@Controller
@RequestMapping("/hb")
public class WxUserCampaignController {
	
	@Resource
	CampaignInstanceService campaignInstanceService;
	
	@Resource
	ICampaignTaskService iCampaignTaskService;
	
	/**
	 * 用户开团接口
	 */
	@ResponseBody
	@RequestMapping(value = "insertCampaignInstance",method = RequestMethod.POST)
	public ResponseForm insertCampaignInstance(@RequestBody RequestForm param) {
		return campaignInstanceService.insertCampaignInstance(param);
	}
	
	/**
	 *  用户参团接口
	 */
	@ResponseBody
	@RequestMapping(value = "insertCampaignTask",method = RequestMethod.POST)
	public ResponseForm insertCampaignTask(@RequestBody RequestForm param) {
		return iCampaignTaskService.insertCampaignTask(param);
	}
	
	/**
	 * 红包页面显示信息 
	 */
	@ResponseBody
	@RequestMapping(value="showBonusPage",method=RequestMethod.POST)
	public ResponseForm showBonusPage(@RequestBody RequestForm param) {
		return campaignInstanceService.showBonusPage(param);
	}
}
